Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/query-string

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/query-string

TypeScript definitions for query-string

  • 5.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is @types/query-string?

@types/query-string provides TypeScript type definitions for the query-string library, which is used to parse and stringify URL query strings.

What are @types/query-string's main functionalities?

Parse a query string

This feature allows you to parse a query string into an object. The example demonstrates parsing a query string with multiple parameters, including repeated keys.

const queryString = require('query-string');
const parsed = queryString.parse('?foo=bar&abc=xyz&abc=123');
console.log(parsed); // { foo: 'bar', abc: ['xyz', '123'] }

Stringify an object into a query string

This feature allows you to convert an object into a query string. The example shows how an object with multiple parameters, including arrays, is stringified.

const queryString = require('query-string');
const stringified = queryString.stringify({ foo: 'bar', abc: ['xyz', '123'] });
console.log(stringified); // 'foo=bar&abc=xyz&abc=123'

Parse a query string with nested objects

This feature allows you to parse query strings that contain nested objects. The example demonstrates parsing a query string with a nested object.

const queryString = require('query-string');
const parsed = queryString.parse('?foo[bar]=baz');
console.log(parsed); // { foo: { bar: 'baz' } }

Stringify an object with nested objects

This feature allows you to convert an object with nested objects into a query string. The example shows how a nested object is stringified.

const queryString = require('query-string');
const stringified = queryString.stringify({ foo: { bar: 'baz' } });
console.log(stringified); // 'foo[bar]=baz'

Other packages similar to @types/query-string

FAQs

Package last updated on 13 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc